<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
    {include file="common_header"}
    <title>添加文章</title>
    <style>
        .red{
            border: 1px solid red;
        }

    </style>
</head>
<body>
<div class="page-container">
    <form class="form form-horizontal" id="form-article-add" enctype="multipart/form-data" method="post" action="{:url('add')}">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>文章标题：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="请输入文章标题" id="articletitle" name="title" datatype="*" nullmsg="文章标题为空">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1">封面图：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="file" class="input-text" value="" placeholder="" id="articletitle2" name="coverFile">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1">文章外部链接：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value=""  placeholder="该文章有外部链接请输入" id="sources" name="link">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>文章类型：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box">
                    <select name="type" id="type" class="select" datatype="*"  nullmsg="请选择文章类型" onchange="changes($(this))">
                         <option disabled selected>请选择文章类型</option>
                          <option value="1">图文信息</option>
                          <option value="2">单篇文章</option>
                     </select>
				</span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>所属栏目：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box">
                    <select name="column_id" id="columnid" class="select" datatype="*"  nullmsg="请选择栏目">
                        <option disabled selected value="0">请选择栏目</option>
                            {volist name=':getlist()' id="v"}
                               <option value="{$v['id']}">{$v['name']}</option>
                            {/volist}
                     </select>
				</span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-1">文章摘要：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <textarea name="discription" cols="" rows="" class="textarea"  placeholder="说点什么...最少输入10个字符" datatype="*"  nullmsg="文章摘要不能为空" ></textarea>
            </div>
        </div>

        <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1">文章内容：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <textarea  id="content" name="content" cols="30" rows="10" style="width:100%;height:400px;"></textarea>
                    <!--<script id="editor" type="text/plain" style="width:100%;height:400px;"></script>-->
                </div>
          </div>
          <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-1">
                    <button class="btn btn-primary radius" type="submit"> 提交审核</button>
                 </div>
          </div>
            </form>
       </div>
    </div>
</body>
{include file="common_footer"}
<script type="text/javascript">
    $(function () {
       UE.getEditor('content');
    });
    function changes(obj) {
            $('#columnid').find("option[value!='0']").removeAttr("selected");
            $('#columnid').find("option[value!='0']").removeAttr("disabled");
        if(obj.val()==2){
            $("select[name='column_id']").find("option[value='8']").attr("selected",true);
            $("select[name='column_id']").find("option[value!='8']").attr("disabled",true);
        }else{
            $("select[name='column_id']").find("option[value='8']").attr("disabled",true);
            $("select[name='column_id']").find("option[value='0']").attr("disabled",true);
            $("select[name='column_id']").find("option[value='3']").attr("selected",true);
        }
    }
</script>
</html>